package ru.study.thinkin.chapter6;

import java.util.Random;

public class Singleton {
	private static  Singleton instance;
	private int id = new Random().nextInt(100);
	
	private Singleton() {
		System.out.println("==new Singl");
	};
		
	public static synchronized  Singleton getInstance() {
		if (instance==null) {
			instance = new Singleton();
		}
		return instance;
	}

	public int getId() {
		return id;
	}
}
